package com.gsx.service.Impl;

import com.gsx.entity.UserInfo;
import com.gsx.mapper.UserMapper;
import com.gsx.service.UserService;
import com.gsx.utils.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public UserInfo checkUser(String username, String password) {
        UserInfo user=userMapper.checkUser(username, MD5Util.code(password));
        return user;
    }

    public int newUser(UserInfo user){
        return userMapper.newUser(user);
    }

    public UserInfo getUserInfo(String username){
        return userMapper.getUserInfo(username);
    }

    public int getUserBlogCont(Long user_id){
        return userMapper.getUserBlogCont(user_id);
    }

    public int updateUser(UserInfo userInfo){
        return userMapper.updateUser(userInfo);
    }
}
